<?php
/**
 * Created by inline.
 * User: swb
 * Date: 2022-11-09
 * Time: 18:17
 */
namespace app\store\controller\api\v1;
use library\Controller;
use app\common\controller\BaseApiController;
use app\common\facade\Token;
use app\common\model\Account as ShopAccountLog;

class Account extends BaseApiController
{
    public function getIndex(){
        $store_id = $this->request->param('store_id');
        $Aid = $this->request->param('Aid',0);
        if ($Aid == 0) {
            $res = ShopAccountLog::where('store_id',$store_id)->with(['user','order'])->select();
        }else {
            $res = ShopAccountLog::where('store_id',$store_id)->where('id',$Aid)->with(['user','order'])->find();
        }
        
        $this->successCode($res);
    }
}